#ifndef __RING_BUFFER_H__
#define __RING_BUFFER_H__

#include "main.h"

#define BUFFER_SIZE 128

typedef struct
{
   uint8_t buff[BUFFER_SIZE];
   volatile uint32_t pW;
   volatile uint32_t pR;
}ring_buffer;

void ring_buffer_init(ring_buffer *cir_buf);
int ring_buffer_write(ring_buffer *cir_buf, uint8_t data);
int ring_buffer_read(ring_buffer *cir_buf, uint8_t *data);

#endif

